﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace 水费管理系统
{
    public partial class 抄表查询 : Form
    {
        public 抄表查询()
        {
            InitializeComponent();
        }

        private void 抄表BindingNavigatorSaveItem_Click(object sender, EventArgs e)
        {
            this.Validate();
            this.抄表BindingSource.EndEdit();
            this.抄表TableAdapter.Update(this.dataSet1.抄表);

        }

        private void 抄表查询_Load(object sender, EventArgs e)
        {
            // TODO: 这行代码将数据加载到表“dataSet1.抄表”中。您可以根据需要移动或移除它。
            this.抄表TableAdapter.Fill(this.dataSet1.抄表);

        }

        private void fillBy用户单位1ToolStripButton_Click(object sender, EventArgs e)
        {
            try
            {
                this.抄表TableAdapter.FillBy用户单位1(this.dataSet1.抄表, 用户单位ToolStripTextBox.Text);
            }
            catch (System.Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }

        }

        private void fillBy户名1ToolStripButton_Click(object sender, EventArgs e)
        {
            try
            {
                this.抄表TableAdapter.FillBy户名1(this.dataSet1.抄表, 户名ToolStripTextBox.Text);
            }
            catch (System.Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }

        }

        private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e)
        {
            抄表录入 cblr = new 抄表录入();
            cblr.ShowDialog();
        }

        private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
        {

        }

        private void 抄表DataGridView_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            打印 dy = new 打印(打印.id_打印类别.抄表, Convert.ToInt32(抄表DataGridView["ID", e.RowIndex].Value));
            dy.ShowDialog();
        }

        private void 保存SToolStripButton_Click(object sender, EventArgs e)
        {
            this.Validate();
            this.抄表BindingSource.EndEdit();
            this.抄表TableAdapter.Update(this.dataSet1.抄表);
        }

        private void 打印PToolStripButton_Click(object sender, EventArgs e)
        {
            //DataTable dt;
            //dt 
            //dt.sb 
        }
    }
}